Release 10.1A: OpenEdge Development:
AppBuilder
The message-handling relationship: internal details
The process for handling a message is very much the same regardless of whether the message is coming in or going out.
Outbound message and reply-handling process
Sending a message requires cooperation between the SmartProducer and an object serving as the
OUTMESSAGE-SOURCE(OMS). Generally you would use either a SmartB2BObject or a SmartSender as OMS. Figure 6–10 illustrates the process.Figure 6–10: Outbound message-handling process
![]()
The steps below describe the process.
- When a message is to be sent, the OMS calls
sendMessagein the SmartProducer.- The
sendMessage()routine in the SmartProducer creates an empty message. It then callssendHandler()in the OMS, passing the handle of the message it created.- The
sendHandler()routine in the OMS sets the message header properties, adds a body to the message, and returns.- The
sendMessage()routine in the SmartProducer now has a complete message to send and calls the relevant routines in the 4GL-JMS API to start the message on its way.- When a reply comes in,
replyHandler()in the SmartProducer callsreplyHandler()in the OMS, passing it the handle of the reply.- The
replyHandler()routine in the OMS gets the ID of the original message and the reply properties and body. It performs any desired processing on that information and returns.Inbound message-handling and reply process
Receiving a message requires cooperation between the SmartConsumer and an object serving as the
INMESSAGE-TARGET(IMT). Generally you would use either a SmartB2BObject or a SmartReceiver as IMT. Figure 6–11 illustrates this process.Figure 6–11: Inbound message-handling process
![]()
If you use a SmartRouter to distribute incoming messages, the SmartRouter acts as an IMT proxy, accepting calls from the SmartConsumer and passing them on transparently to the real IMT. The brief description below ignores the role of the SmartRouter:
- When a message is received, the
messageHandler()routine in the SmartConsumer calls thereceiveHandler()routine in the IMT, passing the handle of the received message.- The
receiveHandler()routine in the IMT extracts header properties and the message body, performs any desired processing, and returns.- If the message requires a reply, the
messageHandler()routine in the SmartConsumer creates an empty reply message and callssendReplyHandler()in the IMT, passing the handle of the reply it created.- The
sendReplyHandler()routine in the IMT sets the header properties, adds a body, and returns.- The
messageHandler()routine in the SmartConsumer now has a complete reply message to send and calls the relevant routines in the 4GL-JMS API to start it on its way.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |